package com.wen.common.utils;

/**
 * 常量
 */
public class Constant {

    private Constant() {}

    /**
     * redis-OK
     */
    public static final String OK = "OK";

    /**
     * redis过期时间，以秒为单位，一分钟
     */
    public static final int EXRP_MINUTE = 60;

    /**
     * redis过期时间，以秒为单位，一小时
     */
    public static final int EXRP_HOUR = 60 * 60;

    /**
     * redis过期时间，以秒为单位，一天
     */
    public static final int EXRP_DAY = 60 * 60 * 24;

    /**
     * redis-key-前缀-shiro:cache:
     */
    public static final String PREFIX_SHIRO_CACHE = "shiro:cache:";

    /**
     * redis-key-前缀-shiro:access_token:
     */
    public static final String PREFIX_ACCESS_TOKEN = "access_token:";

    /**
     * redis-key-前缀-shiro:refresh_token:
     */
    public static final String PREFIX_REFRESH_TOKEN = "refresh_token:";

    /**
     * JWT-account:
     */
    public static final String ACCOUNT = "userName";

    /**
     * JWT-currentTimeMillis:
     */
    public static final String CURRENT_TIME_MILLIS = "currentTimeMillis";

    /**
     * PASSWORD_MAX_LEN
     */
    public static final Integer PASSWORD_MAX_LEN = 8;

    /**
     * 用户登录最大重试次数
     */
    public static final int DEFAULT_USER_MAX_RETRY_NUM = 3;

    /**
     *  用户锁定时间
     */
    public static final int DEFAULT_USER_LOCK_TIME = 10;

    public static class RedisKey {

        private RedisKey() {
            throw new AssertionError();
        }

        public static final String USER_TOKEN = "user_token:";
        public static final String USER_LOCK_PREFIX = "user_lock_prefix:";
        public static final String USER_LOCK_CACHE = "user_lock_cache:";
        public static final String USER_LOCK_TIME = "user_lock_time:";
        public static final String USER_LOCK_NUM = "user_lock_num:";

    }

}
